package com.lxb;

public class OneEditAway {
    public static void main(String[] args) {

        String first = "ab";
        String second = "bc";

        char[] chars1 = first.toCharArray();
        char[] chars2 = second.toCharArray();
        int num = Math.min(chars1.length,chars2.length);
        boolean flag = true;
        int flag_num = 0;
        if(Math.abs(chars1.length-chars2.length) >= 2){
            flag = false;
        }else {
            for (int i = 0,j=0; i < chars1.length && j < chars2.length;) {
                if (chars1[i] != chars2[j]) {
                    i++;
                    flag_num++;
                }else{
                    i++;
                    j++;
                }
            }
            if(flag_num > 1 ){
                flag = false;
            }
            if(flag_num == 1 && chars1.length==chars2.length){
                flag = false;
            }
        }

        System.out.println(flag);

    }
}
